package com.corona.game.util.pool;

import com.badlogic.gdx.utils.Pool;
import com.badlogic.gdx.utils.Pools;

/* loaded from: pokewilds.jar:com/pkmngen/game/util/pool/AutoPool.class */
public class AutoPool<T> extends Pool<AutoPoolable<T>> {
    private final Pool<T> pool;

    public AutoPool(Class<T> type) {
        this.pool = Pools.get(type, 15);
    }

    @Override // com.badlogic.gdx.utils.Pool
    public AutoPoolable<T> obtain() {
        AutoPoolable<T> poolable = (AutoPoolable) obtain();
        poolable.set(this.pool.obtain());
        return poolable;
    }

    @Override // com.badlogic.gdx.utils.Pool
    public AutoPoolable<T> newObject() {
        return new AutoPoolable<>(this, this.pool);
    }
}
